<?php

namespace App\Http\Controllers;

use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Foundation\Auth\Access\AuthorizesResources;

class Controller extends BaseController
{
    use AuthorizesRequests, AuthorizesResources, DispatchesJobs, ValidatesRequests;

	protected $error = [];

	protected $tokenMobileApi;

	protected function setError($err)
	{
		if(!(is_string($err) || is_numeric($err))) {
			$err = json_encode($err);
		}
		array_push($this->error, $err);
		return FALSE;
	}

	protected function getError()
	{
		return $this->error;
	}

	public function check($request)
	{
//		if(! $request->is(static::ROUTE_PREFIX)) {
//			return $this->setError('Route prefix is error.');
//		}
		//验证手机端api的访问权限
		//TODO

		return TRUE;
	}
}
